package qs.openxt.libs.util;


public class StringUtil {
	public static boolean isNull(Object obj) {
		if (obj == null || "".equals(obj.toString().trim())
				|| "null".equals(obj.toString().trim())
				|| "undefined".equals(obj.toString().trim())) {
			return true;
		} else
			return false;
	}

	public static String getValue(Object obj) {
		if (isNull(obj))
			return "";
		else
			return obj.toString();
	}

	public static String byte2hex(byte[] paramArrayOfByte) {
		StringBuffer localStringBuffer = new StringBuffer();
		for (int i = 0; i < paramArrayOfByte.length; ++i)
			localStringBuffer.append(Integer
					.toHexString(256 + (paramArrayOfByte[i] & 0xFF))
					.substring(1).toUpperCase());
		return localStringBuffer.toString();
	}
}
